﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Design
{
    public partial class HindiForm : Form
    {

        public  String hindiText
        {
            get
            {
                HtmlElement textboxhindi = WbHindi.Document.GetElementById("id 1");
                return textboxhindi.InnerText;
            }
        }

        public HindiForm()
        {
            InitializeComponent();
            CreateHindiBox();
        }


        public void CreateHindiBox()
        {
            WbHindi.Navigate("D:/Project SimpleCMS/Content/hindi.html");
            WbHindi.ObjectForScripting = new ScriptManager(this);
            Object[] o = new object[1];
            o[0] = "Hi from jscript";
            Object result = this.WbHindi.Document.InvokeScript("CreateCustomHindiTextArea", o);
        }

        [System.Runtime.InteropServices.ComVisible(true)]
        //<Runtime.InteropServices.ComVisible(True)> _
        public class ScriptManager
        {
            HindiForm _form;
            public ScriptManager(HindiForm form)
            {
                _form = form;
            }

            public void ShowMessage(object obj)
            {
                MessageBox.Show(obj.ToString());
            }

        }

        private void btnHindiInsert_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        private void HindiForm_Resize(object sender, EventArgs e)
        {
            if (this.WindowState == FormWindowState.Maximized)
            {
               // WbHindi.Size.Width = 0;
                PanelHindi.Width = this.Width;
                PanelHindi.Height = this.Height - 100;
               // btnOk. = this.Height - 50;
                panelBtn.Width = this.Width;
                panelBtn.Height =  58;
              
            }
            if (this.WindowState == FormWindowState.Normal)
            {
               // WbHindi.Size.Width= WbHindi.Size.Height;//  = 0;
               // PanelHindi.Dock = DockStyle.Fill;
                PanelHindi.Height = this.Height - 100;
                PanelHindi.Width = this.Width;
                panelBtn.Width = this.Width;
                panelBtn.Height =58;
            }
        }


    }


}
